<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<div id="app">
	<div>
		<input v-model="inputValue"/>
		<button @click="handleSubmit">提交</button>
	</div>
	<ul>
		<todo-item
			v-for="(item, index) of list"
			:key="index"
			:xxx="item"
			>
		</todo-item>
	</ul>
</div>
<script>
	Vue.component('todo-item',{
		props: ['xxx'],
		template: '<li>{{xxx}}</li>',
	})
	new Vue({
		el:'#app',
		data:{
			inputValue:'',
			list:[]
		},
		methods:{
			handleSubmit:function(){
				this.list.push(this.inputValue);
				this.inputValue='';
			}
		}
	})
</script>
</html>